/**
 * Outsider.com.cn.
 * Copyright (c) 2011-2020 All Rights Reserved.
 */
package com.yuanmeng.common.core.enums;

import lombok.Getter;

/**
 * @author outsider
 * @version Id: ApplyStatusEnum.java, v 0.1 2020/12/16 18:23 outsider Exp $$
 */
@Getter
public enum DeliveryTypeEnum {
    EXPRESS("EXPRESS", "快递"),

    CITY("CITY", "同城配送"),

    PICK("PICK", "到店自提");

    private String code;

    private String message;

    DeliveryTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String codeQueryValue(String deliveryType) {
        for(DeliveryTypeEnum ENUM : DeliveryTypeEnum.values()) {
            if(ENUM.code.equals(deliveryType)) {
                return ENUM.getMessage();
            }
        }
        return "";
    }

    public static String valueQueryCode(String deliveryTypeValue) {
        for(DeliveryTypeEnum ENUM : DeliveryTypeEnum.values()) {
            if(ENUM.message.equals(deliveryTypeValue)) {
                return ENUM.getCode();
            }
        }
        return "";
    }
}
